import { axiosServer } from '../utils/request'

// 获取系统管理员登录
export const Glogin = (username: string, password: string) => {
    return axiosServer({
        method: 'post',
        url: '/api/admin/login',
        data: {
            username,
            password
        }
    })
}

// 获取全部医师登录
export const Plogin = () => {
    return axiosServer({
        method: 'post',
        url: '/api/phys/cs'
    })
}

// 获取轮播接口
export const Banner = () => {
    return axiosServer({
        method: 'get',
        url: '/api//admin/AllqueryBanner'
    })
}

// 获取管理员接口
export const PhyAdmin = () => {
    return axiosServer({
        method: 'get',
        url: '/api/admin/AllqueryPhy'
    })
}
// 获取全部用户接口
export const UserAdmin = () => {
    return axiosServer({
        method: 'get',
        url: '/api/admin/AllqueryUser'
    })
}

// 获取预约记录接口
export const yY = () => {
    return axiosServer({
        method: 'get',
        url: '/api/admin/yY'
    })
}

// 根据id获取用户接口
export const queryUser = (id: string) => {
    return axiosServer({
        method: 'get',
        url: '/api/admin/queryUser',
        params: { id }
    })
}

// 修改用户接口
export const ChangeUserAdmin = (_id: number, username: any, fullname: any, age: number) => {
    return axiosServer({
        method: 'post',
        url: '/api/admin/UpdateUser',
        data: {
            _id,
            username,
            fullname,
            age,
        }
    })
}

// 修改医师信息接口
export const ChangePhyAdmin = (_id: number, username: any, fullname: any, age: number) => {
    return axiosServer({
        method: 'post',
        url: "/api/admin/UpdatePhy",
        data: {
            _id,
            username,
            fullname,
            age,
        }
    })
}

// 删除用户接口
export const DeletUserAdmin = (_id: number) => {
    return axiosServer({
        method: 'post',
        url: '/api/admin/delUser',
        data: {
            _id
        }
    })
}
// 删除医师接口
export const DeletPhyAdmin = (_id: number) => {
    return axiosServer({
        method: 'post',
        url: '/api/admin/delPhy',
        data: {
            _id
        }
    })
}